package Servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

public class BCDServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("通过请求转发req请求对象读取共享的属性信息");
        System.out.println("请求转发的类型是："+req.getDispatcherType());
        java.util.Map<String,Object> map =(java.util.Map<String,Object>)req.getAttribute("map");
        String message=(String)map.get("message");
        String status=(String)map.get("status");
        java.util.ArrayList<String> list =(java.util.ArrayList<String>)map.get("list");
        System.out.println("message:"+message);
        System.out.println("status:"+status);
        System.out.println("list:");
        for (String l:list) {
            System.out.println(l);
        }
    }
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    }
}
